home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 5 / chrpro3.zip / CFBSETUP.CMD < prev    next >
OS/2 REXX Batch file  |  1991-01-21  |  7KB  |  214 lines

  1. * Program CFBSETUP - Sets up all functions for running MPROFILE
  2. Store T to LEVEL2
  3.   Erase
  4.   @ 1,1 say chname
  5.   @ 2,1 say 'DATA DISK = '+D
  6.   @ 4,23 say ' CFBUDGET Set-up Functions                 5-/CFBSETUP/'
  7.   @ 8,9 say  '1)  Start a new ACCOUNTS file'
  8.   @ 9,9 say  '2)  Re-index the existing ACCOUNTS or BDIRFILE file'
  9.   @ 10,9 say '3)  Names Directory - church financial/budget parameters'
  10.   @ 11,9 say '4)  Printer start-up - initializes print characters'
  11.   @ 12,9 say '5)  Copy a file to external format'
  12. ?
  13. Accept '         Enter selection ' to MSEL
  14. ?
  15. Do while @(msel,'12345Qq')=0
  16.   Accept 'Invalid entry. Please enter again ' to MSEL
  17. enddo
  18.   Do CASE
  19.     CASE msel='1'
  20.       Store d+':ACCOUNTZ' to MFILEX
  21.       Store d+':ACCOUNTS' to MFILE
  22.       Use &MFILEX
  23.       Accept 'About to create a new ACCOUNTS file on the data disk. OK? ' to xx
  24.       If !(XX)='Y'
  25.       ? 'Now copying file ACCOUNTZ to ACCOUNTS.'
  26.       Copy to &MFILE
  27.       Use &MFILE
  28.       Index on account to &MFILE
  29.       Use &MFILE index &MFILE
  30.       ? 'Copying is complete.'
  31.       endif
  32.       Release MFILEX
  33.     CASE MSEL = '2'
  34.         Accept 'Enter name of file to be indexed ' to MFILE
  35.         If !(MFILE)='BDIRFILE'
  36.           Store MFILE to MFILENDX
  37.           Store 'SPACT' to MFILEKEY
  38.         else
  39.           Store d+':'+MFILE to MFILE
  40.           Accept 'Enter fields to be indexed on ' to MFILEKEY
  41.           Accept 'Enter new index file name ' to MFILENDX
  42.         endif
  43.       If file(MFILE)
  44.         Use &MFILE
  45. ? 'Now indexing file',MFILE,'by',MFILEKEY,'creating index',MFILENDX
  46.         Set talk on
  47.         Index on &MFILEKEY to &MFILENDX
  48.         Set talk off
  49.         Use
  50.       else
  51.         ? 'File',MFILE,'does not exist. '
  52.         Accept 'Press <retn> ' to XX
  53.       endif
  54.       Use
  55.     CASE MSEL = '3'
  56. Clear
  57. Use bdirfile index bdirfile
  58. STORE $(SPACT,4,27) TO MD1A
  59. SKIP
  60. STORE $(SPACT,21,1) TO MD1B
  61. GOTO 18
  62. If !($(spact,31,1))='N'
  63.   Store 'NO ' to MD8
  64. else
  65.   Store 'YES' to MD8
  66. endif
  67. SKIP
  68. Store $(spact,26,2) to MD3a
  69. Store $(spact,29,2) to MD3b
  70. SKIP
  71. Store $(spact,27,2) to MD4a
  72. Store $(spact,30,2) to MD4b
  73. SKIP
  74. Store $(spact,27,2) to MD5a
  75. Store $(SPACT,30,2) to MD5b
  76. SKIP
  77. STORE $(spact,26,2) to MD6a
  78. Store $(spact,29,2) to MD6b
  79. GOTO 23
  80. Store $(spact,12,18) to MD11
  81. GOTO 25
  82. Store $(spact,27,2) to MD12
  83.   Erase
  84. @ 13,7 say ' ________________________________________________________________'
  85. @ 14,7 say '|                                                                |'
  86. @ 15,7 say '|                                           Date __(a,b)________ |'
  87. @ 16,7 say '|                                                                |'
  88. @ 17,7 say '|  Pay __(c,d)____long amount_____________  Amount $ __(e,f)____ |'
  89. @ 18,7 say '|                                                                |'
  90. @ 19,7 say '|  to the order of ___(g,h)_______________                       |'
  91. @ 20,7 say '|                                                                |'
  92. @ 21,7 say '|                    (address)                                   |'
  93. @ 22,7 say '|                                                                |'
  94. @ 23,7 say '|________________________________________________________________|'
  95.   @ 1,10 SAY ' EDITING CHURCH BUDGET PARAMETERS'
  96.   @ 3,0  SAY 'CHURCH NAME     ' GET MD1A
  97.   @ 4,0 SAY  'Disk I.D. containing data files ' GET MD1B
  98.   @ 5,0 say  'Check printing parameters -'
  99.   @ 6,4 SAY  '(a,b) Row and column of check date  ' get MD3a
  100.   @ 6,44 say ',' get MD3b
  101.   @ 7,4 say  '(c,d) Row and column of check long amount' get MD4a
  102.   @ 7,49 say ',' get MD4b
  103.   @ 8,4 say  '(e,f) Row and column of check amount' get MD5a
  104.   @ 8,44 say ' ' get MD5b
  105.   @ 9,4 say  '(g,h) Row and column of check name  ' get MD6a
  106.   @ 9,44 say ' ' get MD6b
  107.   @ 10,0 say 'Print long amount value on the check? ' get MD8
  108.   @ 11,0 say 'Printer, special set-up characters' get MD11
  109.   @ 11,55 say ' Press <ctrl-W> to exit.'
  110.   @ 12,0 say 'Number of print lines on a check form ' get MD12
  111.   READ
  112. Accept '                                                         SAVE? ' to XX
  113. If !(XX)='Y'
  114. GOTO 1
  115. Replace spact with $(spact,1,3)+MD1A
  116. skip
  117. Replace spact with $(spact,1,20)+MD1B
  118. GOTO 18
  119. Replace spact with ' R Print long amount on check?'+!($(MD8,1,1))
  120. SKIP
  121. Replace spact with $(spact,1,25)+MD3a+','+MD3b
  122. SKIP
  123. Replace spact with $(spact,1,26)+MD4a+','+MD4b
  124. SKIP
  125. Replace spact with $(spact,1,26)+MD5a+','+MD5b
  126. SKIP
  127. Replace spact with $(spact,1,25)+MD6a+','+MD6b
  128. GOTO 23
  129.   Replace spact with $(spact,1,11)+MD11
  130. GOTO 25
  131.   Replace spact with $(spact,1,26)+MD12
  132. endif
  133. Use
  134.       Store T to validd1
  135.       Store '3' to MSEL
  136.       Store T to valid2
  137.       Store F to level2
  138.     CASE msel='4'
  139.       USE BDIRFILE
  140.       GOTO 23
  141.       STORE 13 TO INCHNUM
  142.       ? 'Turn the printer on . . .'
  143.       STORE $(SPACT,INCHNUM,2) TO INCHAR
  144.       Set format to print
  145.       Do while inchar<>' ' .and. inchnum<30
  146.         Store val(inchar) to inchval
  147.         @ 0,inchnum say chr(inchval)
  148.         ? 'ASCII ',inchar
  149.         Store inchnum+3 to inchnum
  150.         STORE $(spact,inchnum,2) to inchar
  151.       enddo
  152.       Release inchar,inchval,inchnum
  153.       Set format to screen
  154.       USE
  155.       ? 'Printer is now initialized.'
  156.     CASE MSEL = '5'
  157.       Use
  158.       Select primary
  159.       Accept 'Enter file name to be copied ' to MFILE
  160.       Store d+':&MFILE' to MFILE
  161.       If .not. file(MFILE)
  162.         Accept 'File not found on data disk. Press <retn>' to MFILE
  163.       else
  164.         Accept 'Enter file index name, or <retn> for none ' to MFILENDX
  165.         If MFILENDX<>' '
  166.         Store d+':&MFILENDX'+'.NDX' to MFILENDX
  167.         If .not. file(MFILENDX)
  168.           ? 'Index file',MFILENDX,'not found.'
  169.           Accept 'Press <retn> ' to MFILE
  170.           RETURN
  171.         else
  172.           Store mfile+' index '+MFILENDX to MFILE
  173.         endif
  174.         endif
  175.         USE &MFILE
  176.         Accept 'Enter selection criteria, or <retn> for none ' to MFILESEL
  177.         ? 'WARNING: The new file will be erased if it already exists.'
  178.         Accept 'Enter new file name ' to MNFILE
  179.         If MFILESEL=' '
  180.           Store ' ' to XFOR
  181.         else
  182.           Store ' for' to XFOR
  183.         endif
  184.         Store d+':&MNFILE' to MNFILE
  185.         ? 'Now copying',MFILE,'to',MNFILE,XFOR,MFILESEL
  186.        If MFILESEL=' '
  187.         Set talk on
  188.         Copy to &MNFILE SDF
  189.         Set talk off
  190.        else
  191.         Set talk on
  192.         Copy to &MNFILE for &MFILESEL SDF
  193.         Set talk off
  194.        endif
  195.       endif
  196.       Use
  197.       Release XFOR,MFILESEL,MNFILE,XX
  198.     CASE !(MSEL) = 'Q'
  199.       Store F to LEVEL2
  200.       RETURN
  201.     OTHERWISE
  202.       Accept 'Illegal selection. Please enter again ' to MSEL
  203.       Store F to valid2
  204.   ENDCASE
  205. ENDDO
  206. If LEVEL2
  207.   Accept 'Processing is complete. Press <retn> ' to XX
  208. endif
  209. RETURN
  210.                      |'
  211. @ 21,7 say '|                    (address)                                   |'
  212. @ 22,7 say '|                                                                |'
  213. @ 23,7 say '|________________________________________________________________|'
  214.   @ 1,10 SAY ' EDI